.class public final Lorg/jboss/netty/util/internal/QueueFactory;
.super Ljava/lang/Object;
.source "QueueFactory.java"


# static fields
.field private static final useUnsafe:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 29
    const-class v0, Lorg/jboss/netty/util/internal/QueueFactory;

    invoke-virtual {v0}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v0

    invoke-static {v0}, Lorg/jboss/netty/util/UnsafeDetectUtil;->isUnsafeFound(Ljava/lang/ClassLoader;)Z

    move-result v0

    sput-boolean v0, Lorg/jboss/netty/util/internal/QueueFactory;->useUnsafe:Z

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 33
    return-void
.end method

.method public static createQueue(Ljava/lang/Class;)Ljava/util/concurrent/BlockingQueue;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class",
            "<TT;>;)",
            "Ljava/util/concurrent/BlockingQueue",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 43
    .local p0, itemClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    sget-boolean v0, Lorg/jboss/netty/util/internal/QueueFactory;->useUnsafe:Z

    if-eqz v0, :cond_0

    .line 44
    new-instance v0, Lorg/jboss/netty/util/internal/LinkedTransferQueue;

    invoke-direct {v0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue;-><init>()V

    .line 46
    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Lorg/jboss/netty/util/internal/LegacyLinkedTransferQueue;

    invoke-direct {v0}, Lorg/jboss/netty/util/internal/LegacyLinkedTransferQueue;-><init>()V

    goto :goto_0
.end method

.method public static createQueue(Ljava/util/Collection;Ljava/lang/Class;)Ljava/util/concurrent/BlockingQueue;
    .locals 1
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection",
            "<+TT;>;",
            "Ljava/lang/Class",
            "<TT;>;)",
            "Ljava/util/concurrent/BlockingQueue",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 58
    .local p0, collection:Ljava/util/Collection;,"Ljava/util/Collection<+TT;>;"
    .local p1, itemClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    sget-boolean v0, Lorg/jboss/netty/util/internal/QueueFactory;->useUnsafe:Z

    if-eqz v0, :cond_0

    .line 59
    new-instance v0, Lorg/jboss/netty/util/internal/LinkedTransferQueue;

    invoke-direct {v0, p0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue;-><init>(Ljava/util/Collection;)V

    .line 61
    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Lorg/jboss/netty/util/internal/LegacyLinkedTransferQueue;

    invoke-direct {v0, p0}, Lorg/jboss/netty/util/internal/LegacyLinkedTransferQueue;-><init>(Ljava/util/Collection;)V

    goto :goto_0
.end method
